package com.reflect.entity;

/**
 * @author wzm
 * @create 2023-04-06 10:16
 */
//实体  存储信息
public class Student {
    //属性
  public int id;
  private String name;
  private int age;

  //构造方法 get/set  toString


    public Student() {
    }

    //私有构造函数
    private Student(String name, int age) {
        this.id = id;
        this.name = name;
        this.age = age;
    }

    public Student(int id, String name, int age) {
        this.id = id;
        this.name = name;
        this.age = age;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Student{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    //定义几个普通的方法
    public void sleep(){
        System.out.println("学生在睡觉");
    }

    public String eat(String food){
        return "吃"+food;
    }

    private String sayHello(String na){
        System.out.println("学生打招呼");
        return na;
    }


}
